Skip to content

Docs/env vars contract ids custom rpc wallet flow - #324

Merged
valoryyaa-byte merged 4 commits into
RWA-ToolKit:mainfrom
Mimah97:docs/env-vars-contract-ids-custom-rpc-wallet-flow
Aug 31, 2026
Merged

Docs/env vars contract ids custom rpc wallet flow#324
valoryyaa-byte merged 4 commits into
RWA-ToolKit:mainfrom
Mimah97:docs/env-vars-contract-ids-custom-rpc-wallet-flow

Conversation

@Mimah97

@Mimah97 Mimah97 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds four pieces of previously-missing documentation:

  • Every NEXT_PUBLIC_* environment variable the app actually reads, with purpose, type, and defaults
  • The deployed contract IDs per network and how to override them (including hardcoded testnet
    defaults vs. empty mainnet defaults)
  • A complete guide to running against a local or custom Soroban RPC, with failover behavior explained
  • A full accounting of the wallet connection flow and all real Freighter failure modes the code
    handles (not installed, locked, wrong network, rejected)

Every documented claim was traced to actual source code, not written from general assumption.

Changes

#236 — docs: document every NEXT_PUBLIC_* environment variable

  • Complete NEXT_PUBLIC_* inventory in docs/environment-variables.md: network config (default
    network, RPC URLs, fallback URLs), contract IDs (testnet with hardcoded defaults, mainnet requiring
    explicit setup), optional API URL, app metadata
  • Cross-checked against lib/stellar.ts, lib/contracts.ts, lib/api.ts, next.config.mjs, and
    .github/workflows/web.yml
  • Documented local vs. CI defaults (CI does not set these vars; app falls back to hardcoded defaults
    or public endpoints)

#237 — docs: document deployed contract IDs per network and override mechanism

  • docs/environment-variables.md Contract IDs section: per-network values, required/optional
    status, hardcoded defaults for testnet, empty defaults for mainnet, and override mechanism for each
  • Updated README with links to contract ID documentation in
    docs/environment-variables.md#contract-ids
  • Documented why mainnet IDs default to empty (intentional safeguard against pointing at undeployed
    contracts)

#238 — docs: add README section on running against a local or custom RPC

  • New file docs/custom-rpc.md: local quickstart (Soroban Docker), custom RPC provider setup, and
    failover URL configuration
  • Explained actual failover behavior: 3 consecutive failures per URL, round-robin through list,
    wrapped by public default
  • Included troubleshooting section for common issues (connection refused, high latency, contract not
    found)

#239 — docs: document wallet connection flow and Freighter failure modes

  • New file docs/wallet-connection.md: connection flow diagram, detection → prompt → network sync
  • All four real Freighter states the code handles: not installed, locked, wrong network, rejected
  • Error boundary behavior, polling for account/network changes (8s interval, paused when tab hidden),
    session persistence via localStorage
  • Summary table and testing guide for all states
  • Traced to actual code: lib/freighter.ts, hooks/useWallet.tsx,
    components/wallet/ConnectButton.tsx

Test Plan

  • Read docs/environment-variables.md end-to-end; verify every variable name matches code and
    defaults match hardcoded values in lib/stellar.ts and lib/contracts.ts
  • Read docs/custom-rpc.md; verify failover threshold (3) matches
    lib/stellar.ts:FAILOVER_THRESHOLD
  • Follow local RPC quickstart instructions; verify http://localhost:8000 works
  • Read docs/wallet-connection.md; verify error messages match actual Freighter API strings in
    lib/freighter.ts
  • Test wallet connection states locally if possible (not installed, locked, wrong network,
    rejected)

Closes #236, Closes #237, Closes #238, Closes #239

@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@Mimah97 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@valoryyaa-byte
valoryyaa-byte merged commit 6484a44 into RWA-ToolKit:main Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants